/*
 * Copyright (C) 2010 Mirrodance
 *
 */
#ifndef __FS_TYPES_H
#define __FS_TYPES_H

#include <xen/types.h>

//typedef long long	loff_t;
typedef unsigned short	dev_t;
typedef unsigned short	mode_t;

/*
 * Below are truly Linux-specific types that should never collide with
 * any application/library that wants linux/types.h.
 */

typedef __kernel_off_t		off_t;
typedef __kernel_pid_t		pid_t;

typedef unsigned short		uid_t;
typedef unsigned short		gid_t;

#ifndef _SSIZE_T
#define _SSIZE_T
typedef __kernel_ssize_t	ssize_t;
#endif

#ifdef __CHECKER__
#define __bitwise__ __attribute__((bitwise))
#else
#define __bitwise__
#endif
#ifdef __CHECK_ENDIAN__
#define __bitwise __bitwise__
#else
#define __bitwise
#endif

typedef __u16 __bitwise __le16;
typedef __u16 __bitwise __be16;
typedef __u32 __bitwise __le32;
typedef __u32 __bitwise __be32;
typedef __u64 __bitwise __le64;
typedef __u64 __bitwise __be64;

typedef __u16 __bitwise __sum16;
typedef __u32 __bitwise __wsum;

typedef unsigned __bitwise__ fmode_t;

/**
 * The type used for indexing onto a disc or disc partition.
 *
 * Linux always considers sectors to be 512 bytes long independently
 * of the devices real block size.
 *
 * blkcnt_t is the type of the inode's block count.
 */
#ifdef CONFIG_LBD
typedef u64 sector_t;
typedef u64 blkcnt_t;
#else
typedef unsigned long sector_t;
typedef unsigned long blkcnt_t;
#endif

#ifndef __attribute_const__
# define __attribute_const__	/* unimplemented */
#endif

# define __force

typedef unsigned long	ino_t;

#endif
